<template>
  <div id="app">
    <button @click="showModal = true">打开模态框</button>
    <modal :visible="showModal" @on-confirm="confirm" />
  </div>
</template>

<script>
import modal from "./components/modal.vue";
export default {
  name: "App",
  data() {
    return {
      showModal: false,
    };
  },
  methods: {
    confirm() {
      this.showModal = false;
    },
  },
  components: {
    modal,
  },
};
</script>

<style></style>
